package com.daydayup.learn;

import java.util.ArrayList;
import java.util.List;

public class DebugDemo {

    private static int x;
    static void testEmbedd() {
        x = 55;
        System.out.println("AAAAAAAAAAAAA");
        test2();
        System.out.println("BBBBBBBBBBBBB");
        System.out.println("CCCCCCCCCCCCC");
        System.out.println("DDDDDDDDDDDDD");
        System.out.println("EEEEEEEEEEEEE");
    }

    static void test2() {
        x = 77;
        System.out.println("==============");
        System.out.println("&&&&&&&&");
    }

    public static void main(String[] args) {
//        Map<Integer,String> map = new HashMap<>();
//        map.put(1,"a");
//        map.put(2,"b");
//        System.out.println("!!!!!!");
//        System.out.println("@@@@@@");
//        testEmbedd();
//        map.put(3,"c");
//        map.put(4,"d");
//        map.put(5,"e");
//        map.put(6,"f");
//        map.put(7,"g");
//        System.out.println("oooooooo");
//        Integer i = null;
//        System.out.println(i.intValue());
//        USB p = new Phone();
//        p.insert();
//        USB c = new Computer();
//        c.insert();
        arrayListExpansion();
    }

    /**
     * 数组扩容,考察每次arraylist扩容的逻辑,初始默认值扩容2次后是多少
     */
    static void arrayListExpansion() {
        List<Integer> list = new ArrayList<>();
        for (int i = 0; i < 17; i++) {
            list.add(i);
        }
        list.forEach(r -> System.out.println(r + " "));
    }
}

interface USB{
    void insert();
}

class Phone implements USB{

    @Override
    public void insert() {
        System.out.println("手机支持USB接口");
    }
}

class Computer implements USB{

    @Override
    public void insert() {
        System.out.println("电脑支持USB接口");
    }
}